var vm = new Vue({
    el:'#main',
    data:{
        requirement:{
            name:null,
            num:1,
            price:null,
            bail:0,
            brokerage:null,
            categoryId:null,
            description:null,
            mode:null,
            platformId:null,
            type:null,
            goodsPath:null,
            rewardPath:null,
            type:1,
            daysNum:20
        },
        showGoodsPathImg:false,
        modeList:[],
        ptList:[],
        queryFirmInfo:{
            key:'',
            idPicUrl:''
        },
        info:{
            price:'10'
        }
    },
    methods: {

    },
    mounted:function () {
//获取收费类型
        var feeParam = {"code":"001"};
        $.ajax({
            type: "POST",
            url: baseURL + "/programa/getByPCode",
            dataType: "json",
            async: true,
            contentType:"application/json",
            data:JSON.stringify(feeParam),
            success: function(r){
                if (r.code===0) {
                    vm.modeList = r.data;
                }else{
                    alert(r.info);
                }
            }
        });
        //获取平台类型
        $.ajax({
            type: "GET",
            url: baseURL + "/coustomer/getPlatform",
            dataType: "json",
            async: true,
            contentType:"application/json",
            data:null,
            success: function(r){
                if (r.code===0) {

                    vm.ptList = r.data;
                }else{
                    alert(r.info);
                }
            }
        });

        var param ={
            "id":getParam("id")
        }
        $.ajax({
            type: "GET",
            url: baseURL + "/merchant/getRequirementById",
            dataType: "json",
            async: true,
            contentType:"application/json",
            data:param,
            success: function(r){
                if (r.code===0) {
                    vm.requirement=r.data;
                    setTimeout(function () {
                        document.getElementById('description').contentWindow.editor.html(r.data.description);
                    },2000);

                }else{
                    alert(r.info);
                }
            }
        });
    }
});